home *** CD-ROM | disk | FTP | other *** search
- Path: news.cyberhighway.net!usenet
- From: "Joe E. Coffland" <jcofflan@onyx.idbsu.edu>
- Newsgroups: comp.lang.c
- Subject: merge algorithm
- Date: Thu, 22 Feb 1996 14:30:01 -0800
- Organization: none
- Message-ID: <312CEE69.842@onyx.idbsu.edu>
- NNTP-Posting-Host: pm2-24.cyberhighway.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (Win16; I)
-
- I am trying to find an algorithm to merge two sorted arrays containing
- n elements.
- ie. A[1] <= A[2]<= ... <= A[m] and A[m+1] <= A[m+2] <= ... <A[n]
- The algorithm must run in O(n) time and require only a small amount of
- fixed additional memory regardless of the size of m or n. I have reason
- to believe that there is such an algorithm but I have only been able to
- find algorithms that meet the memory restriction but run in at best
- O(nlogn) and are recursive (which can through some work of course be
- changed in to an iterative algorithm). If any one can point me to a book
- or any other source of information on the subject or just get me headed
- in the right direction it would be greatly appriciated.
-
- Thank you in advance,
- Joe Coffland
- please mail to: jcofflan@onyx.idbsu.edu
-